package pub.elephants.net.body;

/**
 * response
 */
public class ElephantsResponse extends ElephantsAbsMessage {

    private Throwable error;
    private Object result;
    private long sysCurrentTimeMillis;


    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    public Throwable getError() {
        return error;
    }

    public void setError(Throwable error) {
        this.error = error;
    }

    public long getSysCurrentTimeMillis() {
        return sysCurrentTimeMillis;
    }

    public void setSysCurrentTimeMillis(long sysCurrentTimeMillis) {
        this.sysCurrentTimeMillis = sysCurrentTimeMillis;
    }

    @Override
    public String toString() {
        return "ElephantsResponse{" +
                "error=" + error +
                ", result=" + result +
                ", sysCurrentTimeMillis=" + sysCurrentTimeMillis +
                '}';
    }

    public boolean isSuccess() {
        return error == null ? true : false;
    }
}
